package com.gadgets.cm01.role.controller;

import com.gadgets.cm01.auth.dto.AuthorityTreeDTO;
import com.gadgets.cm01.auth.pojo.Authority;
import com.gadgets.cm01.role.dto.RoleAuthAllocationDTO;
import com.gadgets.cm01.role.dto.RoleAuthQueryDTO;
import com.gadgets.cm01.role.pojo.RoleAuthorityRelation;
import com.gadgets.framework.common.dto.HttpBaseResp;
import com.gadgets.framework.common.dto.Pagination;
import com.gadgets.framework.common.exception.GadgetsServiceException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author UncleXiu
 * @version V1.0.0
 * @data 2020-10-10
 *
 */
public interface IRoleAuthAllocationController {

    /**
     * 角色权限分配
     * @param request                   请求信息
     * @param response                  应答信息
     * @param authAllocationDTO         权限操作信息
     * @throws GadgetsServiceException  异常信息
     */
    HttpBaseResp<Object> roleAuthAllocation(HttpServletRequest request, HttpServletResponse response, RoleAuthAllocationDTO authAllocationDTO) throws GadgetsServiceException;

    /**
     * 查询菜单归属角色
     * @param request                   请求信息
     * @param response                  应答信息
     * @param queryDTO                  查询条件
     * @param pagination                分页条件
     * @return                          应答结果
     * @throws GadgetsServiceException  异常信息
     */
    HttpBaseResp<RoleAuthorityRelation> selectAuthRoleByCondition(HttpServletRequest request, HttpServletResponse response, RoleAuthQueryDTO queryDTO, Pagination pagination) throws GadgetsServiceException;

    /**
     * 角色下菜单信息查询
     * @param request                   请求信息
     * @param response                  应答信息
     * @param queryDTO                  查询条件
     * @return                          菜单列表
     * @throws GadgetsServiceException  异常信息
     */
    HttpBaseResp<Authority> selectAuthorityListByCondition(HttpServletRequest request, HttpServletResponse response, RoleAuthQueryDTO queryDTO, Pagination pagination) throws GadgetsServiceException;

    /**
     * 角色下菜单树信息查询
     * @param request                   请求信息
     * @param response                  应答信息
     * @param queryDTO                  查询条件
     * @return                          菜单列表
     * @throws GadgetsServiceException  异常信息
     */
    AuthorityTreeDTO selectAuthrityTreeByCondition(HttpServletRequest request, HttpServletResponse response, RoleAuthQueryDTO queryDTO) throws GadgetsServiceException;

    /**
     * 用户查询菜单信息
     * @param request                   请求信息
     * @param response                  应答信息
     * @param queryDTO                  查询条件
     * @return                          菜单树
     * @throws GadgetsServiceException  异常信息
     */
    public AuthorityTreeDTO selectAuthorityTreeForUser(HttpServletRequest request, HttpServletResponse response, RoleAuthQueryDTO queryDTO)throws GadgetsServiceException;

}
